<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.util.Map;" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="<%=request.getContextPath()%>/public/css/style.model.css">
<!-- core -->
<script src="<%=request.getContextPath()%>/public/js/jquery-1.5.1.min.js"></script>
</head>
<body>
<div class="container">
<h2><c:out value="${model.m_title }"/></h2>
<form action='<%=request.getContextPath()%>/c?<c:out value="${ model.m_action }"/>&m_id=${model.m_id}&o=${p}&v=${v}&pri=${pri}&key=${key}' class='<c:out value="${ model.m_attr_class }"/>'  method="post" <c:out value="${ model.m_attr_other }"/> id='<c:out value="${ model.m_attr_id }"/>' >
<fieldset>
<h4><c:if test="${p eq 'edit' }">修改</c:if><c:if test="${p eq 'add' }">新增</c:if></h4>
<%  Object o =request.getAttribute("e");
Map<String,Object> e = null;
if(null!=o){ e = (Map<String,Object>)o; }%>
<c:forEach var="control" items="${controls }" >
<c:set var="attr_name" value="${control.mc_attr_name }" scope="request"/>
<c:if test="${!control.mc_auto}">
<div class="form-line">
	<label>${control.mc_prompt }:</label>
	<span class="${control.c_attr_class }">
	<c:choose>
    <c:when test="${control.c_tag eq 'textarea'}">
	<textarea name="${control.mc_attr_name }" class="txtarea"><%= e!=null?e.get(request.getAttribute("attr_name").toString()):"" %></textarea>
    </c:when>
    <c:when test="${control.c_tag eq 'select'}">
    <select class=""></select>
    </c:when>
    <c:when test="${control.c_tag eq 'radio'}">
    
    </c:when>      
    <c:otherwise>
    <input type="${control.c_tag }" name="${control.mc_attr_name }" class="field" value="<%= e!=null?e.get(request.getAttribute("attr_name").toString()):"" %>"/>
    </c:otherwise>  
    </c:choose>
	</span>
	<span class="tip">${control.mc_tip }</span>
</div>
<div class="cl"></div>
</c:if>
</c:forEach>
<div class="form-line">
	<button class="btn">保存</button>
</div>
<div class="cl"></div>
</fieldset>
</form>
</div>
	
</body>
</html>